import java.util.EventObject;
import java.util.LinkedList;
import java.util.Queue;

public class BlackBoard {
	protected static Queue<String> queue= new  LinkedList<String>();;
	protected static BoardListener bl = new BoardListener();
	public static String _TXT_PATH="C:/Documents and Settings/Administrator/Desktop/mas/ProiectMAS/Txt-uri/";
	
	public BlackBoard()
	{
	}

	public static String get()
	{
        if (!queue.isEmpty())
        {
        	String line=queue.remove();
        	return line;
        }       
        return "BlackBoard gol";

	}
	public static void add(String s)
	{
		queue.add(s);
		fireEvent(new java.util.EventObject(queue));
	}
	
	  public static void fireEvent(EventObject o) 
	  {
		  bl.handleEvent(o);
	  }
}